package com.sneakxy.cloudbase.platform.bean;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;

import com.sneakxy.cloudbase.platform.utils.web.HttpServletRequestUtils;

public class UEditorSetting {

	private String downloadUrlPrefix;

	public String getFullUrl(HttpServletRequest request, String uri) {
		if(StringUtils.isBlank(getDownloadUrlPrefix())) {
			return HttpServletRequestUtils.getFullPath(request, uri);
		}
		return StringUtils.join(getDownloadUrlPrefix(), uri);
	}
	
	public String getDownloadUrlPrefix() {
		return downloadUrlPrefix;
	}

	public void setDownloadUrlPrefix(String downloadUrlPrefix) {
		this.downloadUrlPrefix = downloadUrlPrefix;
	}
	
}
